<template>
    <div class="ordering">
        <div>
        <el-page-header>
            <template #breadcrumb>
                <el-breadcrumb separator="/">
                    <el-breadcrumb-item :to="{ path: 'home' }">
                        学生主页
                    </el-breadcrumb-item>
                    <el-breadcrumb-item>我的评价</el-breadcrumb-item>
                </el-breadcrumb>
            </template>
        </el-page-header>
    </div><br/>
        <div class="heading">企业审核表</div><br/>
        <div>
            <el-table :data="tableData" height="400" style="width: 100%">
                <el-table-column prop="evaluationDate" label="时间" min-width="100" :formatter="formatDate" />
                <el-table-column prop="companyName" label="企业" min-width="100" />
                <el-table-column prop="evaluationContant" label="评价内容" min-width="100" />
                
            </el-table>
        </div>
        <br/>
        <el-button type="info" @click="bbb">返回</el-button><br/>
        <div
            style="height: 150px; width: auto; border-style:dashed;border-width: 0.1px;border-color: gray;border-radius:10px;">
            <p style="text-indent: 2em; color: #545c64; font-size:2px;">
                希望同学们认真进行评价,禁止发布不良言论，一旦发出就不可更改。一定对自己的言论负责！！！！
            </p><br />
        </div>
        <br/>
        
    </div>
</template>

<script setup>
import { ref, onBeforeMount, reactive } from 'vue'
import requests from '@/api/ajax.js'
import { useRouter } from 'vue-router'

const dialogFormVisible = ref(false)
const formLabelWidth = '140px'



const textarea = ref({
    evaluationcontant:'',
})

function ooo(){
     dialogFormVisible.value = true;
    textarea.value.evaluationcontant = '';
}

onBeforeMount(() => {

//请求能够发出组队邀请的学生信息
const aacom = requests({ url: "/students/allMyEvaluationVo", method: "get", }).then(res => {
    //存储用户信息到浏览器toke
    const abc = res.rdata
    tableData.value = abc
    console.log(res)
})
    .catch(err => {
        console.error(err.data);
        // 登录请求失败后的操作
    });
})

const tableData = ref([{
    evaluationId: '',
    companyId: '',
    evaluationContant: '',
    memberId: '',
    evaluationDate: '',
    studentId: '',
    memberState: '',
    teamId: '',
    companyName: '',
    companyInfo: '',
    companyPhone: '',
    companyTrade:'',
    companyPassword: '',
}])


const aaa = ref([
    {
        companyId: '1',
        companyName: '叽叽叽叽',
        companyPhone: '145564648548',
        companyInfo: '非常好',
        companyTrade: '大数据',
    },
    {
        companyId: '2',
        companyName: 'ikun',
        companyPhone: '1649879764646',
        companyInfo: '小黑子',
        companyTrade: '互联网',
    },
])


//时间格式化
function formatDate(row, column, cellValue, index) {
    let format = 'YYYY-mm-dd'
    let date = new Date(cellValue);
    const dataItem = {
        'Y+': date.getFullYear().toString(),
        'm+': (date.getMonth() + 1).toString(),
        'd+': date.getDate().toString(),
    }
    Object.keys(dataItem).forEach((item) => {
        const ret = new RegExp(`(${item})`).exec(format);
        if (ret) {
            format = format.replace(ret[1], ret[1].length === 1 ? dataItem[item] : dataItem[item].padStart(ret[1].length, '0'));
        }
    });
    return format
}


const router_useRouter = useRouter()
function bbb() {
  router_useRouter.push({ path: 'companyEvaluate' })
}
</script>

<style scoped>
.el-button--text {
  margin-right: 15px;
}
.el-select {
  width: 300px;
}
.el-input {
  width: 300px;
}
.dialog-footer button:first-child {
  margin-right: 10px;
}
</style>